ifeq ($(strip $(PLATFORM)),)
	PLATFORM = cell
endif

##Package Details
SFOXML				:=	package/sfo.xml
ICON0				:=	package/ICON0.png
TITLE				:=	Mednafen
APPID				:=	MDFN90002
CONTENTID			:=	UP0001-$(APPID)_00-0000000000000000

##Mednafen config
MEDNAFENFLAGS		:=	-DWANT_SMS_EMU -DWANT_MD_EMU -DWANT_WSWAN_EMU -DWANT_NGP_EMU -DWANT_PCE_EMU -DWANT_VB_EMU -DWANT_LYNX_EMU -DNEED_Z80_EMULATOR -DWANT_PCFX_EMU -DNETWORK
MEDNAFENCONFIG		:=	-DPSS_STYLE=1 -DHAVE_MKDIR -DMEDNAFEN_VERSION=\"0.9.16\" -DMEDNAFEN_VERSION_NUMERIC=0x916 -DSIZEOF_DOUBLE=8
MEDNAFENINCLUDES	:=	. src/src/hw_misc src/src/hw_video src/include src/src/hw_cpu src/src/sms src/src/hw_sound src/include/blip src/src/ngp src/src/ngp/TLCS-900h src/src/snes/src/lib

##Build info
TARGET				:=	mednafen
TYPE				:=	bin
PACKAGE				:=	mednafen.pkg
BUILD				:=	build
SOURCE				:=	src src/src src/filters src/src/cdrom src/src/compress  src/src/hw_cpu/c68k src/src/hw_cpu/huc6280 src/src/hw_cpu/v810 \
						src/src/hw_cpu/v810/fpu-new src/src/hw_cpu/z80-fuse src/src/hw_misc/arcade_card src/src/hw_sound/pce_psg \
						src/src/hw_sound/sms_apu src/src/hw_sound/ym2413 src/src/hw_sound/ym2612 src/src/hw_video/huc6270 src/src/lynx src/src/md \
						src/src/md/cart src/src/md/input src/src/mpcdec  \
						src/src/ngp src/src/ngp/TLCS-900h src/src/pce src/src/pce/input src/src/pcfx src/src/pcfx/input \
						src/src/sms src/src/sound src/src/string src/src/tremor src/src/trio src/src/vb src/src/video src/src/wswan src/src/md/cd 

##Maybe remove these later, they aren't used often
MEDNAFENFLAGS		+=	-DWANT_GB_EMU -DWANT_NES_EMU -DWANT_PCE_FAST_EMU -DWANT_GBA_EMU -DWANT_SNES_EMU 
SOURCE				+=	src/src/gb src/src/hw_sound/gb_apu src/src/pce_fast src/src/nes src/src/nes/boards src/src/nes/input src/src/nes/ntsc src/src/nes/ppu src/src/nes/ppu/palettes src/src/gba

CXXFILES			:=	src/src/snes/interface.cpp src/src/snes/src/cartridge/cartridge.cpp src/src/snes/src/cheat/cheat.cpp \
						src/src/snes/src/memory/memory.cpp src/src/snes/src/memory/smemory/smemory.cpp src/src/snes/src/cpu/cpu.cpp src/src/snes/src/cpu/core/core.cpp src/src/snes/src/cpu/scpu/scpu.cpp \
						src/src/snes/src/smp/smp.cpp src/src/snes/src/smp/core/core.cpp src/src/snes/src/smp/ssmp/ssmp.cpp src/src/snes/src/dsp/sdsp/sdsp.cpp src/src/snes/src/ppu/ppu.cpp \
						src/src/snes/src/ppu/bppu/bppu.cpp src/src/snes/src/system/system.cpp src/src/snes/src/chip/sa1/sa1.cpp src/src/snes/src/chip/bsx/bsx.cpp src/src/snes/src/chip/srtc/srtc.cpp \
						src/src/snes/src/chip/sdd1/sdd1.cpp src/src/snes/src/chip/spc7110/spc7110.cpp src/src/snes/src/chip/cx4/cx4.cpp src/src/snes/src/chip/dsp1/dsp1.cpp src/src/snes/src/chip/dsp2/dsp2.cpp \
						src/src/snes/src/chip/dsp3/dsp3.cpp src/src/snes/src/chip/dsp4/dsp4.cpp src/src/snes/src/chip/obc1/obc1.cpp src/src/snes/src/chip/st010/st010.cpp src/src/snes/src/chip/st011/st011.cpp \
						src/src/snes/src/chip/st018/st018.cpp src/src/snes/src/chip/superfx/superfx.cpp src/src/snes/src/chip/21fx/21fx.cpp
CFILES				:=	src/src/snes/src/lib/libco/libco.c
ifeq ($(strip $(PLATFORM)),l1ght)
	SFILES			:=	src/src/snes/src/lib/libco/blargg_libco_ppc64-5/ppc.S
	MEDNAFENFLAGS	+=	-DLIBCO_PPC_ASM
endif

INCLUDE				:=	src ../system $(MEDNAFENINCLUDES) 
LIBDIRS				:=	../system ../nestopia ../gambatte ../vbam ../pcsxr

CFLAGS				:=	$(MEDNAFENFLAGS) $(MEDNAFENCONFIG)
CXXFLAGS			:=	$(MEDNAFENFLAGS) $(MEDNAFENCONFIG)
LIBS				:=	-lemusys-$(PLATFORM) -lnestopia-$(PLATFORM) -lgambatte-$(PLATFORM) -lpcsxr-$(PLATFORM) -lvbam-$(PLATFORM)

ifneq ($(BUILD)-$(PLATFORM),$(notdir $(CURDIR)))
	include $(CURDIR)/../Makefile-$(PLATFORM).base
else
	include $(CURDIR)/../../Makefile-$(PLATFORM).base
endif


